www.gusucode.com > 云枫工作室企业网站源码 1 > 云枫工作室企业网站源码 1.0/云枫工作室企业网站源码(asp无限制版)1.0/web/admin/Manage_modpro.asp

    <!--#include file="conn.asp"-->
<!--#include file="check.asp" -->
<%
set rspaixu=server.createobject("adodb.recordset")
paixusql="select * from Tsm_pro order by paixu desc"
rspaixu.open paixusql,conn,1,1
if not rspaixu.eof then
thelastpaixu=rspaixu("paixu")+1
else
thelastpaixu=1
end if
rspaixu.close
set rspaixu=nothing


select case request("action")
	case "add"
	call add()
	case "addsave"
	call addsave()
	case "Modify"
	call Modify()
	case "Modifysave"
	call Modifysave()
end select
%>
<%
sub add()
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title></title>
<%
dim rs
dim sql
dim count
set rs=server.createobject("adodb.recordset")
sql = "select * from Tsm_prosc"
rs.open sql,conn,1,1
%>
<!--#include file="classjs.asp"-->
<link href="css.css" rel="stylesheet" type="text/css">
</head>
<body>
<!--#include file="top.htm"-->
<br>
<table width="90%" height="25"  border="0" align="center" cellpadding="0" cellspacing="0">
  <form name="myform" method="post" action="?action=addsave"><tr>
    <td height="25" align="center" valign="middle" background="img/menu_manage.gif"><font color="#FFFFFF"><b>发 布 信 息</b></font></td>
  </tr>
  <tr>
    <td>
<table width="100%"  border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#CCCCCC">
  <tr align="center" valign="middle" bgcolor="#FFFFFF">
    <td height="25" colspan="2">&nbsp;</td>
    </tr>
  <tr>
    <td width="15%" height="25" align="center" valign="middle" bgcolor="#F6F6F6">类别:</td>
    <td width="85%" bgcolor="#FFFFFF">
         <%
        sql = "select * from tsm_probc"
        rs.open sql,conn,1,1
		if rs.eof and rs.bof then
			response.write "请先添加大类。"
		else
		%>
        <select name="Aid" onChange="changelocation(document.myform.Aid.options[document.myform.Aid.selectedIndex].value)" size="1">
          <option selected value="<%=rs("aid")%>"><%=trim(rs("aname"))%></option>
          <%
			dim selclassid
		    selclassid=rs("aid")
        	rs.movenext
		    do while not rs.eof
			%>
          <option value="<%=trim(rs("aid"))%>"><%=trim(rs("aname"))%></option>
          <%
		        rs.movenext
    	    loop
		end if
        rs.close
			%>
        </select>
		<select name="Bid" style="display:none">
          <option value="" selected>不指定小类</option>
          <%
			sql="select * from tsm_prosc where aid=" & selclassid & ""
			rs.open sql,conn,1,1
			if not(rs.eof and rs.bof) then
			%>
          <option value="<%=rs("bid")%>"><%=rs("bname")%></option>
          <% rs.movenext
				do while not rs.eof%>
          <option value="<%=rs("bid")%>"><%=rs("bname")%></option>
          <%
			    	rs.movenext
				loop
			end if
	        rs.close
			%>
      </select>
</td>
  </tr>
  <tr<%=hiddentable(0)%>>
    <td height="25" align="center" valign="middle" bgcolor="#FFFFFF">推荐:</td>
    <td bgcolor="#F6F6F6"><input type="radio" name="tj" value="1">
      是
      <input name="tj" type="radio" value="0" checked> 
      否</td>
  </tr>
  <tr>
    <td height="25" align="center" valign="middle" bgcolor="#FFFFFF">名称:</td>
    <td bgcolor="#F6F6F6"><input name="title" type="text" id="title" size="50" maxlength="50">
      <font color="#FF0000"> *</font>      </td>
  </tr>

  <tr style="display:none">
    <td height="25" align="center" valign="middle" bgcolor="#FFFFFF">排序:</td>
    <td bgcolor="#F6F6F6"><input name="paixu" type="text" id="paixu" size="50" maxlength="50" value="<%=thelastpaixu%>">
      <font color="#FF0000"> *</font>      </td>
  </tr>
  <tr>
    <td height="25" align="center" valign="middle" bgcolor="#FFFFFF">上传产品图:</td>
    <td bgcolor="#FFFFFF"><input name="Propic" type="text" id="Propic" size="40">
      <font color="#FF0000">* </font><br><IFRAME src="Upimage.asp" name=head width=370 marginWidth=0 height=21 marginHeight=0 scrolling=no frameBorder=0 class="red" framespacing=0></IFRAME></td>
  </tr>
  <tr<%=hiddentable(0)%>>
    <td height="25" align="center" valign="middle" bgcolor="#FFFFFF">上传缩略图(大):</td>
    <td bgcolor="#FFFFFF"><input name="Propicb" type="text" id="Propicb" size="40">
      <font color="#FF0000">* </font>推荐尺寸:400*400<br><IFRAME src="Upimageb.asp" name=head width=370 marginWidth=0 height=21 marginHeight=0 scrolling=no frameBorder=0 class="red" framespacing=0></IFRAME></td>
  </tr>
  <tr style="display:none">
    <td height="23" align="center" valign="middle" bgcolor="#F6F6F6">推荐:</td>
    <td valign="top" bgcolor="#FFFFFF"><input type="radio" name="jianjie" value="0">  是<input type="radio" name="jianjie" value="1" checked> 否</td>
  </tr>

  <input type="hidden" name="jianjiee">
  <tr>
    <td height="350" align="center" valign="middle" bgcolor="#F6F6F6">详细内容:</td>
    <td height="355" valign="top" bgcolor="#FFFFFF">
<textarea name="content" style="display:none"><%=Server.HTMLEncode(html)%></textarea>
      <iframe ID="eWebEditor1" src="editor/ewebeditor.asp?id=content&style=s_office" frameborder="0" scrolling="no" width="600" HEIGHT="355"></iframe></td>
  </tr>
 
</table>
<table width="100%"  border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
  <tr>
    <td height="35" align="center">
  <input type="submit" name="Submit" value="发布信息">
&nbsp;
  <input type="reset" name="Submit" value=" 清 除 ">
&nbsp;
  <input type="button" name="Submit2" value=" 返 回 " onClick="history.go(-1)">
    </td>
  </tr>
</table>
</td>
  </tr>
  </form>
</table>
</body>
</html>
<%
end sub
%>
<%
sub addsave()

if trim(request("title"))="" or isEmpty(request("title"))=true then
call ShowAlert("名称不可为空,请输入名称!","")

ElseIf trim(request("paixu"))="" and IsNumeric(request("paixu"))=False Then
call ShowAlert("排序必须是数字!","")


ElseIf trim(request("content"))="" or isEmpty(request("content"))=true Then
call ShowAlert("详细内容不可为空,请输入详细介绍!","")

Else

set rscheck=server.createobject("adodb.recordset")
checksql="select * from Tsm_pro where title='"&request("title")&"' and titlee='"&request("titlee")&"' and paixu="&request("paixu")&""
rscheck.open checksql,conn,1,1
if rscheck.eof then

set rs=server.createobject("adodb.recordset")
sql="select * from Tsm_pro"
rs.open sql,conn,1,3
rs.AddNew

if request("Aid")<>"" then
rs("Aid") = request("Aid")
else
rs("Aid") = 0
end if
if request("Bid")<>"" then
rs("Bid") = request("Bid")
else
rs("Bid") = 0
end if
if request("paixu")<>"" then
rs("paixu") = request("paixu")
else
rs("paixu") = 0
end if
rs("tj") = request("tj")
rs("title") = request("title")
rs("titlee") = request("titlee")
rs("Content") = request("Content")
rs("Contente") = request("Contente")
rs("Propic") = request("Propic")
rs("Propic1") = request("Propic1")
rs("Propicb") = request("Propicb")
rs("jianjie") = request("jianjie")
rs("jianjiee") = request("jianjiee")
rs("guige") = request("guige")
rs("guigee") = request("guigee")
rs("shiyong") = request("shiyong")
rs("shiyonge") = request("shiyonge")
rs.Update
rs.Close 
set rs=nothing
end if
rscheck.close
set rscheck=nothing
conn.close
set conn=nothing

call ShowAlert("添加成功!","Manage_adminpro.asp")
End If
end sub
%>
<%
sub Modify()
%>
<%
id=request("id")
set RsEdit=server.createobject("adodb.recordset")
sqlEdit = "select * from Tsm_pro where id="& id
RsEdit.open sqlEdit,conn,1,1
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title></title>
<%
dim rs
dim sql
dim count
set rs=server.createobject("adodb.recordset")
sql = "select * from Tsm_prosc"
rs.open sql,conn,1,1
%>
<!--#include file="classjs.asp"-->
<link href="css.css" rel="stylesheet" type="text/css">
</head>
<body>
<!--#include file="top.htm"--><br>
<table width="90%"  border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#CCCCCC">
 <form name="myform" method="post" action="?action=Modifysave">
 <tr align="center" valign="middle">
    <td height="25" colspan="2" background="img/menu_manage.gif"><font color="#FFFFFF"><b>修 改 信 息</b></font></td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td height="25" colspan="2">&nbsp;</td>
  </tr>
  <tr>
    <td width="15%" height="25" align="center" bgcolor="#F6F6F6">类别:</td>
    <td width="85%" bgcolor="#FFFFFF">
         <%
        sql = "select * from tsm_probc"
        rs.open sql,conn,1,1
		if rs.eof and rs.bof then
			response.write "请先添加栏目。"
		else
		%>
        <select name="Aid" onChange="changelocation(document.myform.Aid.options[document.myform.Aid.selectedIndex].value)" size="1">
          <%
		    do while not rs.eof
			%>
          <option value="<%=rs("aid")%>"<%=selected(rs("aid"),RsEdit("aid"))%>><%=rs("aname")%></option>
          <%
		        rs.movenext
    	    loop
		end if
        rs.close
			%>
        </select>
		<select name="Bid" style="display:none">
          <option value="" selected>不指定小类</option>
          <%
			sql="select * from tsm_prosc where aid=" & RsEdit("aid") & ""
			rs.open sql,conn,1,1
			%>
          <%
				do while not rs.eof%>
          <option value="<%=rs("bid")%>"<%=selected(rs("bid"),RsEdit("bid"))%>><%=rs("bname")%></option>
          <%
			    	rs.movenext
				loop
	        rs.close
			%>
      </select>
	          </td>
  </tr>
  <tr<%=hiddentable(0)%>>
    <td height="25" align="center" valign="middle" bgcolor="#FFFFFF">推荐:</td>
    <td bgcolor="#F6F6F6"><input type="radio" name="tj" value="1"<%=checked(RsEdit("tj"),1)%>>
      是
      <input name="tj" type="radio" value="0"<%=checked(RsEdit("tj"),0)%>> 
      否</td>
  </tr>
  <tr>
    <td height="25" align="center" valign="middle" bgcolor="#FFFFFF">产品名称:</td>
    <td bgcolor="#F6F6F6"><input name="title" type="text" id="title" size="50" maxlength="50" value="<%=RsEdit("title")%>">
      <font color="#FF0000"> *</font>      </td>
  </tr>
 

  <tr style="display:none">
    <td height="25" align="center" valign="middle" bgcolor="#FFFFFF">排序:</td>
    <td bgcolor="#F6F6F6"><input name="paixu" type="text" id="paixu" size="50" maxlength="50" value="<%=RsEdit("paixu")%>">
      <font color="#FF0000"> *</font>      </td>
  </tr>

  <tr>
    <td height="25" align="center" valign="middle" bgcolor="#FFFFFF">上传产品图:</td>
    <td bgcolor="#FFFFFF"><input name="Propic" type="text" id="Propic" size="40" value="<%=RsEdit("Propic")%>">
      <font color="#FF0000">* </font><br><IFRAME src="Upimage.asp" name=head width=370 marginWidth=0 height=21 marginHeight=0 scrolling=no frameBorder=0 class="red" framespacing=0></IFRAME></td>
  </tr>

   <tr style="display:none">
    <td height="23" align="center" valign="middle" bgcolor="#F6F6F6">推荐:</td>
    <td valign="top" bgcolor="#FFFFFF"><input type="radio" <% if trim(RsEdit("jianjie")) = "0" then%>  checked <%end if%> name="jianjie" value="0">  是<input type="radio" name="jianjie" <% if trim(RsEdit("jianjie")) <> "0" then%>  checked <%end if%> value="1"> 否</td>
  </tr>
  
  <input type="hidden" name="jianjiee">
  <tr>
    <td height="350" align="center" valign="middle" bgcolor="#F6F6F6">详细内容:</td>
    <td height="355" valign="top" bgcolor="#FFFFFF">
<textarea name="content" style="display:none"><%=RsEdit("content")%></textarea>
<iframe ID="eWebEditor1" src="editor/ewebeditor.asp?id=content&style=s_office" frameborder="0" scrolling="no" width="600" HEIGHT="355"></iframe></td>
  </tr>

  <tr bgcolor="#FFFFFF">
    <td colspan="2" align="center" valign="middle"><table width="100%" height="35"  border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
      <tr>
        <td height="35" align="center" valign="middle">
          <input name="id" type="hidden" id="id" value="<%=rsEdit("id")%>">
          <input type="submit" name="Submit" value="修改信息">
&nbsp;
      <input type="reset" name="Submit" value=" 清 除 ">
&nbsp;
  <input type="button" name="Submit2" value=" 返 回 " onClick="history.go(-1)">
      </td>
      </tr>
    </table></td>
    </tr>
	</form>
</table>
</body>
</html>
<%
end sub
%>
<%
sub Modifysave()

if trim(request("title"))="" or isEmpty(request("title"))=true then
call ShowAlert("名称不可为空,请输入名称!","")

ElseIf trim(request("paixu"))="" and IsNumeric(request("paixu"))=False Then
call ShowAlert("排序必须是数字!","")

ElseIf trim(request("Propic"))="" or isEmpty(request("Propic"))=true then
call ShowAlert("缩略图不可为空,请上传缩略图!","")

ElseIf trim(request("content"))="" or isEmpty(request("content"))=true Then
call ShowAlert("详细内容不可为空,请输入详细介绍!","")

Else

set rs=server.createobject("adodb.recordset")
sql1="select * from Tsm_pro where id="& request("id")
rs.open sql1,conn,1,3

if request("Aid")<>"" then
rs("Aid") = request("Aid")
else
rs("Aid") = 0
end if
if request("Bid")<>"" then
rs("Bid") = request("Bid")
else
rs("Bid") = 0
end if
if request("paixu")<>"" then
rs("paixu") = request("paixu")
else
rs("paixu") = 0
end if
rs("tj") = request("tj")
rs("title") = request("title")
rs("titlee") = request("titlee")
rs("Content") = request("Content")
rs("Contente") = request("Contente")
rs("Propic") = request("Propic")
rs("Propic1") = request("Propic1")
rs("Propicb") = request("Propicb")
rs("jianjie") = request("jianjie")
rs("jianjiee") = request("jianjiee")
rs("guige") = request("guige")
rs("guigee") = request("guigee")
rs("shiyong") = request("shiyong")
rs("shiyonge") = request("shiyonge")
rs.Update
rs.Close 
set rs=nothing
conn.close
set conn=nothing

call ShowAlert("修改成功!","Manage_adminpro.asp")
End If
end sub
%>